package com.gugee.ins.data.common.msg;

import com.gugee.ins.data.common.util.ProtostuffUtil;
import lombok.Data;
import lombok.ToString;
import org.apache.kafka.common.serialization.Deserializer;
import org.apache.kafka.common.serialization.Serializer;

/**
 * insBlogger消息
 * @author Huangxin
 */
@ToString(callSuper = true)
@Data
public class InsBloggerDbaMessage extends InsMessage{
    /**
     * 任务消息的反序列号
     *
     * @author luolifeng
     * @version 1.0.0
     * Date 2020/10/04
     * Time 15:03
     */
    public static class MsgDeserializer implements Deserializer<InsBloggerDbaMessage> {
        @Override
        public InsBloggerDbaMessage deserialize(String topic, byte[] bytes) {
            return ProtostuffUtil.deserializer(bytes, InsBloggerDbaMessage.class);
        }
    }

    /**
     * Description 类描述
     *
     * @author luolifeng
     * @version 1.0.0
     * Date 2020/10/04
     * Time 15:12
     */
    public static class MsgSerializer implements Serializer<InsBloggerDbaMessage> {
        @Override
        public byte[] serialize(String topic, InsBloggerDbaMessage bloggerMessage) {
            return ProtostuffUtil.serializer(bloggerMessage, InsBloggerDbaMessage.class);
        }
    }
}
